﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace SimpleActor
{
    // interface for proxy
    public interface IMessageScheduler<TServant>
    {
        Task Start();
        Task Stop();

        Func<Task> GetQueueAction(Expression<Func<TServant, Task>> func);
        Func<TParam, Task> GetQueueAction<TParam>(Expression<Func<TServant, TParam, Task>> func);
        Func<TParam1, TParam2, Task> GetQueueAction<TParam1, TParam2>(Expression<Func<TServant, TParam1, TParam2, Task>> func);
        Func<TParam1, TParam2, TParam3, Task> GetQueueAction<TParam1, TParam2, TParam3>(Expression<Func<TServant, TParam1, TParam2, TParam3, Task>> func);
        Func<TParam1, TParam2, TParam3, TParam4, Task> GetQueueAction<TParam1, TParam2, TParam3, TParam4>(Expression<Func<TServant, TParam1, TParam2, TParam3, TParam4, Task>> func);

        Func<Task<TResult>> GetQueueFunc<TResult>(Expression<Func<TServant, Task<TResult>>> func);
        Func<TParam, Task<TResult>> GetQueueFunc<TParam, TResult>(Expression<Func<TServant, TParam, Task<TResult>>> func);
        Func<TParam1, TParam2, Task<TResult>> GetQueueFunc<TParam1, TParam2, TResult>(Expression<Func<TServant, TParam1, TParam2, Task<TResult>>> func);
        Func<TParam1, TParam2, TParam3, Task<TResult>> GetQueueFunc<TParam1, TParam2, TParam3, TResult>(Expression<Func<TServant, TParam1, TParam2, TParam3, Task<TResult>>> func);
        Func<TParam1, TParam2, TParam3, TParam4, Task<TResult>> GetQueueFunc<TParam1, TParam2, TParam3, TParam4, TResult>(Expression<Func<TServant, TParam1, TParam2, TParam3, TParam4, Task<TResult>>> func);

        IObservable<T> GetObservable<T>(Expression<Func<TServant, IObservable<T>>> func);
    }
}
